import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
export default async function a003(fd: IFeidaoAiBrowserComponent) {
	//
	const flag = get(fd, 'flag') as string;
	const no = get(fd, 'no') as string;
	if (flag === '1') {
		//删除客户信息
		const res = await nodejs<{ code: 0 | 1; result: string; }>('customer-care/zj-000004/s001', {
			filter: {
				no
			}
		});
		if (res.code === 1) {
			alert('删除成功');
			window.location.reload();
		} else {
			alert('删除失败');
		}
	} else if (flag === '2') {
		//删除客户信息
		const res1 = await nodejs<{ code: 0 | 1; result: string; }>('customer-care/zj-000004/s002', {
			filter: {
				_id: no
			}
		});
		if (res1.code === 1) {
			alert('删除成功');
			window.location.reload();
		} else {
			alert('删除失败');
		}
	}

}
